export default (initialState, strategy) => {
  if (!initialState || !strategy) {
    throw new Error(`initialState or strategy arguments must have value`);
  }

  return (state=initialState, action) => {
    if (action) {
      const { type } = action;
      if (type && strategy[type]) {
        return strategy[type](state, action); 
      }
    }
    return state;
  };
}